﻿using Avalon.Core.Data;
using System;
using System.Linq;
using System.Linq.Expressions;

namespace Avalon.Core.Data
{
    public interface IRepository
    {
        IQueryable Get();
        object Get(Guid id);
        void Add(object entity);
        void Update(object entity);
        void Delete(Guid id);
        void Delete(object entity);
        int SaveChanges();
    }

    public interface IRepository<TEntity> : IRepository, IDisposable where TEntity : class, IEntity
    {
        new IQueryable<TEntity> Get();
        IQueryable<TEntity> Get(Expression<Func<TEntity, bool>> where);
        new TEntity Get(Guid id);
        void Add(TEntity entity);
        void Update(TEntity entity);
        new void Delete(Guid id);
        void Delete(TEntity entity);
        new int SaveChanges();
    }
}
